section .text
	global strchr

strchr:
	push rbp
	mov rbp, rsp

	xor rax, rax
;;; 	xor rdx, rdx
	mov rax, [rdi]
	pop rdi
	mov cl, byte[rsi]

while:
	cmp byte [rax], cl
	je end_found
	cmp byte [rax], 0
	je endend
	mov rax, [rax - 8]
	jmp while

end_found:
	mov rax, 0
	ret

endend:
;;; 	mov rax, rdx
;;;  	mov rax, [rdi + rdx]
	ret

;;; section .text
;;; 	global strchr

;;; strchr:
;;; 	xor rax, rax
;;; 	mov rdx, rdi
;;; 	mov ah, byte [rsi]
;;; 	jmp .each
;;; 
;;; .count:
;;; 	inc  rdx
;;; .each:
;;; ;;; 	mov al, byte[rdi]
;;; 	cmp byte[rdx], ah
;;; 	jne .count
;;; 	cmp byte[rdx], 0
;;; 	je .default
;;; 
;;; .done:
;;; 	mov rax, rdx
;;; 	ret
;;; 
;;; .default:
;;; 	xor rax, rax
;;; 	ret